Intro

Starter Pack

toddle makes it easy for you to create just about any app you can think of, these are just some elements to help get you started.
This starter pack includes some common UI elements to start a new project such as a dropdown, tooltip, drag and drop list, an inline value edit, buttons, tabs, accordion, and icons. More will be added over time.

Theme Support

Some elements in this pack include support for basic color 'themes'.
More information is noted at the end of this page.

Components

  • Dropdown

    The dropdown component has two slots. The default slot is for the trigger button and the other is for the dropdown content.
    They do not require special settings or actions.
    The dropdown content can be left, center, or right aligned
    Dropdown closes when when trigger button is clicked or when mouse leaves the dropdown content

    *If beneficial, this component might be updated once the Popover API is fully supported by all browsers*

    Attributes

    alignAccepts: left or right
  • Drag and drop list

    The drag-and-drop component takes a list of items [array] and has an update event that returns the updated list when any changes are made to it.
    It can add, edit, rearrange, and delete items to an array.
    The drag-and-drop functionality includes support for mobile

    List

    Attributes

    titleSets the list's title
    list-itemsAccepts an array

    Events

    setUpdatedListReturns the updated list [array] when a user adds, moves, edits, or deletes any list item
  • Inline value edit

    The inline value edit component is a handy little component that takes a value and a value type (ex. date, number, email, etc. Default is text) and returns an updated value if a user edits the content.

    The edit input has autofocus and accepts Enter/Escape presses to set or cancel content edit.

    Example usage is also in the drag-and-drop component above.

    Attributes

    valueThe item's initial value
    value-typeThis sets the input type of the value.
    Accepts 'text', 'number', 'date', 'email', 'tel', etc.
    Default is 'text'
    show-deleteAccepts: Bool True/False
    Default is False

    Events

    setEditedInputReturns the updated value item
    deleteClickedFires when the delete (trash) icon is clicked
  • Tabs

    The tabs component is preconfigured to accept an array with the following object structure:

    [
    {
    "tabName": "tab1",
    "tabContent": "tab content 1"
    },
    {
    "tabName": "tab2",
    "tabContent": "tab content 2"
    }
    ]

    This might be updated with a different approach based on user feedback.
    The tab content block accepts HTML content.
    The selected tab's accent border color is set with the 'accent-variable-name' attribute. Refer to the theme info for more details

    tab1
    tab2

    Attributes

    itemsAccepts an array
  • Accordion

    The accordion component works in 2 parts—the group component and the item component.

    Use the group component to create a group of accordions made up of accordion items.
    Nesting a new accordion group inside an accordion item will create a sub-group of accordions.

    Accordion items have two slots—one for the header which defaults to a regular text element and another default slot for the accordion content.

    Accordion Item

    Attributes

    headerSets the header text. Alternatively, set a custom header via the 'header' slot.
    default-expandedSets whether an accordion should be open by default.
    Default is False
    shapeThis sets the accordion's shape
    Accepts: 'square', 'rounded', or 'pill'
    Default is square
  • Icons

    Some commonly used icons to get started.
    All icons are SVGs and have size, stroke, and color settings.

    Some icons have additional settings.
    - Some examples are orientation for arrows/chevron.
    - The notification bell's "has-notification" accepts Bool true/false which changes the icon. Default notification color is toddle's "Red-700".
    - The mobile menu has 3 style options (enter 1, 2, or 3)

    Attributes

    sizeDefault size is 1rem
    stroke-widthDefault stroke 1.5
    colorDefault is the parent div's font color setting.
  • Tooltip

    The tooltip component has one slot for the tooltip content.
    This demo uses a simple <span> element.
    The tooltip content can be left, center, or right aligned and it can be set to be above or below the trigger button.

    Attributes

    align-itemsAccepts: 'left' (or 'start'), 'center', 'right' (or 'end')
    Default is left/start aligned
    above-belowThis sets the position of the tooltip.
    Accepts: 'above' or 'below'
    Default is above
    sizeThis sets the size of the tooltip icon.
    Default is 1rem
  • Buttons

    The button has slots for left/right icons if needed as well as settings for disabled and autofocus attributes.

    Attributes

    textSets the button's text
    full-widthThis sets the cancel/submit icons inline with the input field.
    Accepts: Bool True/False
    Default is False
    outlineThis sets the button's style to outline only.
    Accepts: Bool True/False
    Default is False
    shapeThis sets the button's shape
    Accepts: 'square', 'rounded', or 'pill'
    Default is square
    disabledUse this to disable the button.
    Accepts: Bool True/False
    Default is False
    autofocusThis sets browser focus on the button, on load of the button.
    Accepts: Bool True/False
    Default is False
    typeThis sets the button's HTML 'type' attribute. Recommended to set to 'submit' when using within a form
    Accepts: 'button', 'submit', or 'reset'
    Default is button

    Events

    buttonClickedFires when the button is clicked

Themes

Some elements in this pack include support for basic color 'themes'.

In the element's attribute color field, you can enter:
"light", "dark", or "accent" to select a theme.
All elements default to 'light' theme.

Accent Colors

Elements that support themes will have an "accent-variable-name" attribute.

This field takes the variable name of the accent color you wish to use for the element, taken from your "Theme" settings.